package com.chaber.containers;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.chaber.containers.config.ProductManagementConfigurator;

public class Initializator {

	public static ApplicationContext initialize(String profiles) {
		System.setProperty("spring.profiles.active", profiles);
		
		System.out.println("ACTIVE PROFILE: " + profiles);

		AnnotationConfigApplicationContext appContext = new AnnotationConfigApplicationContext();
		appContext.register(ProductManagementConfigurator.class);
		appContext.refresh();
		
		return appContext;
	}
	
}
